CREATE EXTERNAL TABLE spmi_dws.dws_spmi_union_bill_dt(
  `bill_generation_date` date COMMENT '账单产生日期',
  `send_network_id` string COMMENT '寄件网点ID',
  `send_network_code` string COMMENT '寄件网点编码',
  `send_network_name` string COMMENT '寄件网点名称',
  `send_financial_center_id` string COMMENT '寄件财务中心ID',
  `send_financial_center_code` string COMMENT '寄件财务中心编码',
  `send_financial_center_name` string COMMENT '寄件财务中心名称',
  `sign_financial_center_id` string COMMENT '签收财务中心ID',
  `sign_financial_center_code` string COMMENT '签收财务中心编码',
  `sign_financial_center_name` string COMMENT '签收财务中心名称',
  `settle_franchisee_id` string COMMENT '结算加盟商ID',
  `settle_franchisee_code` string COMMENT '结算加盟商CODE',
  `settle_franchisee_name` string COMMENT '结算加盟商名称',
  `waybill_nums` bigint COMMENT '票数',
  `waybill_pieces` bigint COMMENT '件数',
  `cost_weights` decimal(12,2) COMMENT '计费重量',
  `settle_weights` decimal(12,2) COMMENT '结算重量',
  `operation_costs` decimal(12,2) COMMENT '操作费',
  `transfer_costs` decimal(12,2) COMMENT '中转费',
  `piece_fee_costs` decimal(12,2) COMMENT '派件费',
  `customer_fees` decimal(12,2) COMMENT '客户运费',
  `waybill_weights` decimal(12,2) COMMENT '入参重量',
  `center_packge_costs` decimal(12,2) COMMENT '中心代建包费',
  `distribu_packge_costs` decimal(12,2) COMMENT '集散代建包费')
COMMENT 'dws层网点中心综合账单汇总表'
PARTITIONED BY (
  `dt` string COMMENT '账单产生日期 (yyyy-MM-dd)')
ROW FORMAT SERDE
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  'hdfs://yl-bg-hdp/dw/hive/spmi_dws.db/external/dws_spmi_union_bill_dt' ;